]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appIcon: End running drag operations on destroy
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Sat, 29 Jun 2019 04:32:40 +0000 (01:32 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 24 Jul 2019 21:11:25 +0000 (18:11 -0300)
AppIcon makes itself draggable, and handles the various DnD
routines such as 'drag-begin' and 'drag-end' by making the
Overview emit the appropriate signals.

However, when destroyed, the AppIcon does not try to finish
any drag operations that started. That causes the event
blocker in AllView not to be updated correctly when dragging
icons to outside folders.

Make AppIcon emit 'item-drag-end' when a drag operation
started and it's destroyed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/643

js/ui/appDisplay.js

index c1b916a5918c629dd0fbacdfd5a9e659cae16720..e7510a36cd5cbb42c87ac97e8f7ac621a3896042 100644 (file)
@@ -1532,13 +1532,16 @@ var AppIcon = class AppIcon {
         if (isDraggable) {
             this._draggable = DND.makeDraggable(this.actor);
             this._draggable.connect('drag-begin', () => {
+                this._dragging = true;
                 this._removeMenuTimeout();
                 Main.overview.beginItemDrag(this);
             });
             this._draggable.connect('drag-cancelled', () => {
+                this._dragging = false;
                 Main.overview.cancelledItemDrag(this);
             });
             this._draggable.connect('drag-end', () => {
+                this._dragging = false;
                 Main.overview.endItemDrag(this);
             });
         }
@@ -1555,6 +1558,10 @@ var AppIcon = class AppIcon {
     _onDestroy() {
         if (this._stateChangedId > 0)
             this.app.disconnect(this._stateChangedId);
+        if (this._draggable && this._dragging) {
+            Main.overview.endItemDrag(this);
+            this.draggable = null;
+        }
         this._stateChangedId = 0;
         this._removeMenuTimeout();
     }